<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>

<rich:panel header="#{messages['complaint.list']}">
	<h:panelGrid>
		<h:outputText value="#{errorBean.errorMessage}" styleClass="error"></h:outputText>
	</h:panelGrid>

	<rich:dataTable id="data" var="obj" value="#{agentComplaintBean.complaintList}" rows="10" width="99%" rowKeyVar="rowNo">
		<rich:column style="text-align:center;width:15%;">
			<f:facet name="header">
				<h:outputText value="#{messages['title']}"></h:outputText>
			</f:facet>
			<h:commandLink action="#{agentComplaintBean.viewAction}" actionListener="#{agentComplaintBean.viewActionListener}">
				<t:outputText value="#{obj.title}"></t:outputText>
			</h:commandLink>
			<f:param value="#{obj.complaintId}" id="vcompId"/>
		</rich:column>
		<rich:column style="text-align:center;width:15%;">
			<f:facet name="header">
				<h:outputText value="#{messages['status']}"></h:outputText>
			</f:facet>
			<t:outputText styleClass="standardText" value="#{obj.statusLabel}"></t:outputText>
		</rich:column>
		<rich:column style="text-align:center;width:15%;">
			<f:facet name="header">
				<h:outputText value="#{messages['read.replied']}"></h:outputText>
			</f:facet>
			<h:commandButton styleClass="button" value="#{messages['action']}" action="#{agentComplaintBean.navReadAction}" actionListener="#{agentComplaintBean.readActionListener}" rendered="#{obj.status==agentComplaintBean.status}"></h:commandButton>
			<h:outputText value="#{messages['not.available']}" rendered="#{obj.status!=agentComplaintBean.status}"></h:outputText>
			<f:param value="#{obj.complaintId}" id="compId"/>
		</rich:column>
	</rich:dataTable>
	
	<rich:spacer height="30" />
	
	<rich:datascroller align="left"  for="data" maxPages="20" />

	<rich:spacer height="30" />
	
	<t:panelGrid columns="1" width="100%">
		<t:panelGroup>
		 	<h:commandButton value="#{messages['create']}" styleClass="button"  immediate="true" action="#{agentComplaintBean.navCreateAction}"></h:commandButton>
		 	<f:verbatim>&nbsp;</f:verbatim>
   			<h:commandButton value="#{messages['cancel']}" styleClass="button" immediate="true" action="#{agentComplaintBean.navBackAction}"></h:commandButton>
   		</t:panelGroup>
	</t:panelGrid>
	
</rich:panel>